package com.ecoolex.chinadutyfree.retailer.admin.graphql;


import com.ecoolex.framework.common.pojo.Result;
import com.ecoolex.framework.web.api.graphql2.annotation.GraphQL2Module;
import com.ecoolex.framework.web.api.graphql2.annotation.GraphQL2Module.Type;
import com.ecoolex.framework.web.api.graphql2.annotation.QueryField;

import com.ecoolex.chinadutyfree.retailer.admin.core.AdminConstant;
/*
@@AdminAuthoritativeRegister(parentKey=Constant.AUTH_MODULE_KEY, 
	key=AdminConstant.AUTH_PROJECT_KEY, 
	name=AdminConstant.AUTH_PROJECT_NAME, 
	remark=AdminConstant.AUTH_PROJECT_REMARK) */

@GraphQL2Module(module = AdminConstant.PROJECT_ADMIN_NAME, 
	type=Type.Admin,
	description="系统默认接口")
public class AdminCoreGraphql {
	
	@QueryField(field="check", description="系统检查")
	public Result check() {
		return Result.createSuccessful();
	}
	
//	@QueryField(field = "checkUserAuth")
//	@UserAuthoritativeRegister(parentKey = Constant.AUTH_MODULE_KEY, key = "CHECK_USER_AUTH", name = "检查用户权限")
//	@AuthParam(key = "USER_NAME", remark = "创建用户", values = { AuthParam.ALL }, defaultValue = AuthParam.ALL)\
//	public Result checkUserAuth(UserAuthUser user) {
//		// 鉴权，无权限抛出异常
//		UserPermit permit = user.assertAuth("CHECK_ADMIN_AUTH");
//		// 参数鉴权, 鉴定参数是否具有权限
//		permit.parameter("ADMIN_USER_NAME").assertAuth(user.userName());
//		return Result.createSuccessful();
//	}
//
//	@QueryField(field = "checkAdminAuth")
//	@AdminAuthoritativeRegister(parentKey = Constant.AUTH_MODULE_KEY, key = "CHECK_ADMIN_AUTH", name = "检查管理权限")
//	@AuthParam(key = "ADMIN_USER_NAME", remark = "创建用户", values = { AuthParam.ALL }, defaultValue = AuthParam.ALL)
//	@MethodCatchException
//	public Result checkAdminAuth(AdminAuthUser user) {
//		// 鉴权，无权限抛出异常
//		AdminPermit permit = user.assertAuth("CHECK_ADMIN_AUTH");
//		// 参数鉴权, 鉴定参数是否具有权限
//		permit.parameter("ADMIN_USER_NAME").assertAuth(user.userName());
//		return Result.createSuccessful();
//	}
//
//	@QueryField(field = "checkPlatformAuth")
//	@PlatformAuthoritativeRegister(parentKey = Constant.AUTH_MODULE_KEY, key = "CHECK_PLATFORM_AUTH", name = "检查平台权限")
//	@AuthParam(key = "PLATFORM_USER_NAME", remark = "创建用户", values = { AuthParam.ALL }, defaultValue = AuthParam.ALL)
//	@MethodCatchException
//	public Result checkPlatformAuth(PlatformAuthUser user) {
//		// 鉴权，无权限抛出异常
//		PlatformPermit permit = user.assertAuth("CHECK_ADMIN_AUTH");
//		// 参数鉴权, 鉴定参数是否具有权限
//		permit.parameter("ADMIN_USER_NAME").assertAuth(user.userName());
//		return Result.createSuccessful();
//	}
}
